package com.ynny.lyl.entity;

import lombok.Data;

@Data
public class R {

    private Integer code;

    private String msg;

    private Object data;

    public R(){

    }

    public R(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static R ok(Object data){

        return new R(200,
                "请求成功",
                data);
    }
    public static R fail(Integer code, String msg){

        return new R(code,
                msg,
                null);
    }
}
